<template>
    <div>
        <nav class="aggregation-header">
            <div>电影榜单</div>
            <div>电视剧榜单</div>
            <div>综艺榜单</div>
        </nav>
        <div class="container">
            <div class="scroll-board">
                <div class="s-boardWarp">
                    <div class="boardCard" v-for="(v,i) in arr" :key="i"  :style="getbg(v)">
                        <div class="mask"></div>
                        <div class="content">
                            <div class="title">
                                <span>{{v.name}}</span>
                                <img src="https://s0.meituan.net/bs/myfe/canary/file/asgard/images/board/arrow-right.png" alt="">
                            </div>
                            <div class="time">更新于2021年09月09日</div>
                            <ul class="list">
                                <li v-for="(v,i) in arr[i].movies" :key="i">
                                    <div class="list-l">
                                        <div>{{v.rank}}</div>
                                        <img :src="v.img|fliterImg" alt="">
                                        <span>{{v.nm}}</span>
                                    </div>
                                    <div class="list-r">
                                        <span>{{v.label.number}}</span>
                                        <span class="text">{{v.label.text}}</span>
                                    </div>
                                </li>
                            </ul>
                        </div>
                        
                    </div>
                </div>
            </div>
        </div>    
    </div>
</template>

<script>
import getLink from "@/api/getLink.js";

export default {
    methods: {
        getbg(v){
            return{
                background:"url(" + v.backGroundImg + ") no-repeat 0 100%"

            }
        }
    },
    data() {
        return {
            arr:[],
            arr1:[]
        }
    },
    mounted() {
        getLink("/api/aggregation").then((res)=>{
            this.arr= res.data;

        })
    },
};
</script>

<style scoped>
::-webkit-scrollbar {
     width: 0 !important;
   }
.aggregation-header{
    height: .84rem;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #666;
    font-size: .3rem;
    font-weight: 500;
    border-bottom: 1px solid #f3f3f3;
    position: fixed;
    z-index: 100;
    background-color: #fff;
    /* top: 1.28rem; */
}
.aggregation-header div{
    font-weight: 500;
    margin: 0 .28rem;
    position: relative;
    height: 100%;
    line-height: .84rem;
    color: #333;
    font-size: .34rem;
}
.container{
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
    list-style: none;
    padding: 0;
    height: auto;
    /* margin-top: .84rem; */
    z-index: 0;
}
.scroll-board{
    list-style: none;
    overflow: hidden;
    white-space: nowrap;
    overflow-x: scroll;
    padding: .3rem .1rem 0 .3rem;
    background-color: #fff;
    vertical-align: middle;
    box-sizing: border-box;
    width: 100%;
}
.scroll-board .s-boardWarp{
    list-style: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    width: 20.8rem;
}
.boardCard{
    list-style: none;
    white-space: nowrap;
    border-radius: .24rem;
    width: 4.96rem;
    position: relative;
    margin-right: .2rem;
    color: #fff;
    background-position: 0 100%;
    flex-shrink: 0;
    /* background: red; */
    /* height: 5rem; */
    margin-top: 0.8rem;
    
    /* background-image: url("http://p1.meituan.net/movie/95d4d741ccff790c12dc08c3a1aff7fe81137.jpg@445h"); */
    background-image: linear-gradient(to right, rgb(28, 49, 69), rgba(28, 49, 69, 0.85) 50%, rgba(28, 49, 69, 0.3));
    background-size: contain;
}
.mask{
    position: absolute;
    opacity: .85;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: .24rem;
    background-image: linear-gradient(to right, rgb(28, 49, 69), rgba(28, 49, 69, 0.85) 50%, rgba(28, 49, 69, 0.3));
    z-index: 3;
}
.content{
    list-style: none;
    white-space: nowrap;
    color: #fff;
    z-index: 3;
    margin: .3rem .18rem .3rem .22rem;
    position: relative;
}
.content .title{
    list-style: none;
    white-space: nowrap;
    font-size: .32rem;
    font-weight: 500;
    font-family: PingFangSC-Medium;
    color: #fff;
    letter-spacing: 0;
}
.title span{
    font-size: .32rem;
    font-weight: 500;
    font-family: PingFangSC-Medium;
    color: #fff;
    letter-spacing: 0;
} 
.title img{
    color: #fff;
    letter-spacing: 0;
    border: 0;
    display: inline-block;
    background: none;
    height: .2rem;
    width: .2rem;
    margin-left: .08rem;
    margin-top: .02rem;
    
}
.time{
    font-weight: 400;
    opacity: .7;
    font-family: PingFangSC-Regular;
    font-size: .22rem;
    letter-spacing: 0;
    height: .22rem;
    line-height: .22rem;
    margin-top: .16rem;
    color: #fff;
}
.list{
    margin-top: .4rem;
    font-weight: 500;
    font-family: PingFangSC-Medium;
    font-size: .26rem;
    color: #fff;
    letter-spacing: 0;
    margin-bottom: 0;
}
.list li{
    margin-bottom: .12rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: .72rem;
}
.list-l{
    display: flex;
    /* justify-content: start; */
    align-items: center;
    flex-grow: 1;
    flex-shrink: 1;
    width: 1rem;
    height: 100%;
}
.list-l div{
    font-size: .26rem;
    color: #fff;
    letter-spacing: 0;
    list-style: none;
    margin-right: .16rem;
    width: .14rem;
}
.list-l img{
    width: 0.52rem;
    height: 0.72rem;

    font-size: .26rem;
    color: #fff;
    letter-spacing: 0;
    list-style: none;
    border: 0;
    display: inline-block;
    background: none;
    border-radius: .08rem;
    height: 100%;
}
.list-l span{
    color: #fff;
    letter-spacing: 0;
    list-style: none;
    margin-left: .16rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    word-break: break-all;
    opacity: .7;
}
.list-r{
    color: #ffa016;
    margin-left: .04rem;
}
.list-r span{
    font-size: .26rem;
    letter-spacing: 0;
    list-style: none;
    color: #ffa016;
}
.list-r .text{
    font-size: .26rem;
    letter-spacing: 0;
    list-style: none;
    color: #ffa016;
    margin-left: .04rem;
}

</style>
